package com.huzp.net.mysql.jdbc;

import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.DriverPropertyInfo;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.Properties;
import java.util.logging.Logger;

/**
 * mysql 驱动
 */
public class MysqlDriver implements Driver {

    public MysqlDriver() throws SQLException {
    }

    static {
        try {
            DriverManager.registerDriver(new MysqlDriver());
        } catch (SQLException var1) {
            throw new RuntimeException("Can't register driver!");
        }
    }


    public Connection connect(String url, Properties info) throws SQLException {
        ConnectionInfo connectionInfo = new ConnectionInfo(url,info);
        return new MysqlConnection(connectionInfo);
    }

    public boolean acceptsURL(String url) throws SQLException {
        return false;
    }

    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
        return new DriverPropertyInfo[0];
    }

    public int getMajorVersion() {
        return 8;
    }

    public int getMinorVersion() {
        return 6;
    }

    public boolean jdbcCompliant() {
        return false;
    }

    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
        return null;
    }
}
